<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <form action="{% url 'blog:edit_action' %}" method="POST">
    {% csrf_token %}
    {% if article %}
      <label for="">
        <input type="text" name="title" value="{{article.title}}">
      </label>
      <br/>
      <label for="">
        <input type="text"  name="content" value="{{ article.content }}">
      </label>
      <input type="text" name="id" value="{{article.id | default:'0'}}">
    {% else %}
      <label for="">
        <input type="text" name="title">
      </label>
      <br/>
      <label for="">
        <textarea name="content" id="" cols="30" rows="10"></textarea>
      </label>
    {% endif %}

    <br/>
    <input type="submit" value="提交">
  </form>
</body>
</html>